# vim: ft=python
{
  'targets': [
    {
      'target_name': 'libprotoserv-descriptors-sources',
      'type': 'none',
      'dependencies': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:protoc',
      ],
      'actions': [
        {
          'action_name': 'compile_descriptors',
          'inputs': [
            '<(DEPTH)/proto/protoserv/protocol.proto',
            '<(DEPTH)/proto/protoserv/transport.proto',
          ],
          'outputs': [
            'src/protoserv/protocol.pb.cc',
            'src/protoserv/protocol.pb.h',
            'src/protoserv/transport.pb.cc',
            'src/protoserv/transport.pb.h',
          ],
          'action': [
            '<(DEPTH)/out/Default/protoc',
            '--proto_path=<(DEPTH)/<(THIRD_PARTY)/protobuf/trunk/src',
            '--proto_path=<(DEPTH)/proto',
            '<(DEPTH)/proto/protoserv/protocol.proto',
            '<(DEPTH)/proto/protoserv/transport.proto',
            '--cpp_out=src',
          ],
        },
      ],
    },
    {
      'target_name': 'libprotoserv-descriptors',
      'type': 'static_library',
      'include_dirs': [
        'src',
      ],
      'dependencies': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:libprotoc',
        'libprotoserv-descriptors-sources',
      ],
      'export_dependent_settings': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:libprotoc',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          'src',
        ],
      },
      'sources': [
        'src/protoserv/protocol.pb.cc',
        'src/protoserv/protocol.pb.h',
        'src/protoserv/transport.pb.cc',
        'src/protoserv/transport.pb.h',
      ],
    },
    {
      'target_name': 'libprotoserv-rpc-plugin',
      'type': 'static_library',
      'include_dirs': [
        'src',
      ],
      'dependencies': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:libprotoc',
        'libprotoserv-descriptors',
      ],
      'export_dependent_settings': [
        '<(DEPTH)/<(THIRD_PARTY)/protobuf/build.gyp:libprotoc',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          'src',
        ],
      },
      'sources': [
        'src/protoserv/compiler/rpc_plugin.cc',
        'src/protoserv/compiler/rpc_plugin.h',
      ],
    },
    {
      'target_name': 'method_hash',
      'type': 'executable',
      'cflags': [ '-O2', '-Os', '-Wall' ],
      'include_dirs': [
        'src',
      ],
      'dependencies': [
        'libprotoserv-rpc-plugin',
      ],
      'sources': [
        'src/protoserv/tools/method_hash.cc',
      ],
    },
  ],
}
